package com.entity.cond;

import org.apache.commons.lang3.StringUtils;

/**
 * @author asan
 * @version 1.0 2015-9-10
 */
public class BaseCond {

    private Integer pageNum = 1;// 当前页
    private Integer pageSize = 50;// 每页显示记录数
    private String orderBy;// 排序字段+ 排序类型
    private String order = "desc";// 排序类型
    private String sort = "id";//排序字段

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        if (StringUtils.isNotBlank(this.sort)) {
            if (StringUtils.isNotBlank(this.order)) {
                return sort + " " + order;
            }
            return sort;
        }
        return orderBy;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }
}
